package com.oz.entity;

import java.sql.Timestamp;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

import org.hibernate.annotations.Comment;
import org.hibernate.annotations.Table;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

@Table(appliesTo = "just_demo", comment = "综合测试")
@Entity(name = "just_demo")
@TableName(value = "just_demo", autoResultMap = false)
public class DemoEntity{
	
	@Id
	@Column(length = 32)
	private String id;

	@Comment("名称")
	@Column(nullable = false, length = 64)
	@TableField(insertStrategy = FieldStrategy.NOT_EMPTY)
	private String name;

	@Comment("活动区域")
	@Column(length = 128)
	private String region;

	@Comment("图片路径")
	@Column(length = 512)
	private String imgs;

	@Comment("测试自动填充")
	@Column(columnDefinition = "timestamp default current_timestamp")
	@JSONField(name = "date1")
	@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
	private Timestamp date1;

	@TableField(update = "now()")
	@JsonFormat(pattern = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
	private Timestamp date2;

	@Comment("是否支持配送")
	private Boolean delivery;

	@Comment("活动类型")
	@Column(length = 128)
	private String classify;

	@Comment("其他资源")
	@Column(length = 128)
	private String resource;

	@Comment("备注")
	@Column(length = 128)
	private String remarks;

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getRegion() {
		return region;
	}

	public void setRegion(String region) {
		this.region = region;
	}

	public String getImgs() {
		return imgs;
	}

	public void setImgs(String imgs) {
		this.imgs = imgs;
	}

	public Timestamp getDate1() {
		return date1;
	}

	public void setDate1(Timestamp date1) {
		this.date1 = date1;
	}

	public Timestamp getDate2() {
		return date2;
	}

	public void setDate2(Timestamp date2) {
		this.date2 = date2;
	}

	public Boolean getDelivery() {
		return delivery;
	}

	public void setDelivery(Boolean delivery) {
		this.delivery = delivery;
	}

	public String getClassify() {
		return classify;
	}

	public void setClassify(String classify) {
		this.classify = classify;
	}

	public String getResource() {
		return resource;
	}

	public void setResource(String resource) {
		this.resource = resource;
	}

	public String getRemarks() {
		return remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

}
